/*
 *  dc1394cam.h
 *  libCV
 *
 *  Created by Gregory Koch on 14/03/11.
 *  Copyright 2011 IFlyBotIV. All rights reserved.
 *
 */

#ifdef COMPIL_DC1394_CAM

#ifndef DC1394CAM_H
#define DC1394CAM_H

#include <time.h>
#include <sys/time.h>
#include <dc1394/dc1394.h>
#include "libCV.h"

#define DC1394_RGB24_160_120 0
#define DC1394_GREY8_160_120 1
#define DC1394_RGB24_320_240 2
#define DC1394_GREY8_320_240 3
#define DC1394_RGB24_640_480 4
#define DC1394_GREY8_640_480 5
#define DC1394_RGB24_800_600 6
#define DC1394_GREY8_800_600 7


typedef struct dc1394cam_s{
	int fdv;
	image_t framebuf;
    dc1394camera_t *camera;
    dc1394_t * d;
    unsigned int format;
    float fps;
    struct timeval tv;
} dc1394cam_t;

dc1394cam_t dc1394cam_open(unsigned int format);
void dc1394cam_close(dc1394cam_t camera);
void dc1394cam_grab_image(dc1394cam_t *camera);


#endif

#endif
